package com.seelyn.rhea.integrate.spring;

import com.seelyn.rhea.mvc.context.Request;
import com.seelyn.rhea.mvc.context.Response;
import com.seelyn.rhea.mvc.internal.InternalFilter;
import com.seelyn.rhea.mvc.route.Filter;

/**
 * @author linfeng
 * @since 2016/1/28
 */
public class InternalFilterImpl extends InternalFilter {

    private final Filter filter;
    private final String method;

    public InternalFilterImpl(String path, String method, Filter filter) {
        super(path);
        this.filter = filter;
        this.method = method;
    }


    @Override
    public int order() {
        return filter.order();
    }

    @Override
    public boolean handle(Request request, Response response) {
        return filter.handle(request, response);
    }

    public Filter getFilter() {
        return filter;
    }

    public String getMethod() {
        return method;
    }
}
